
#ifndef _WDDM_INCLUDE_WDDMPORTIO_H_
#define _WDDM_INCLUDE_WDDMPORTIO_H_

#include "CommonDef.h"

extern void *mappedSysIoPort;

DECLINLINE(void) WRITE_SYSIO_UCHAR(PUCHAR p, UCHAR v)
{
    WRITE_REGISTER_UCHAR((PUCHAR)((char*)mappedSysIoPort + (UINT64)p), v);
}
DECLINLINE(void) WRITE_SYSIO_USHORT(PUSHORT p, USHORT v)
{
    WRITE_REGISTER_USHORT((PUSHORT)((char*)mappedSysIoPort + (UINT64)p), v);
}
DECLINLINE(void) WRITE_SYSIO_ULONG(PULONG p, ULONG v)
{
    WRITE_REGISTER_ULONG((PULONG)((char*)mappedSysIoPort + (UINT64)p), v);
}
DECLINLINE(UCHAR) READ_SYSIO_UCHAR(PUCHAR p)
{
    return READ_REGISTER_UCHAR((PUCHAR)((char*)mappedSysIoPort + (UINT64)p));
}
DECLINLINE(USHORT) READ_SYSIO_USHORT(PUSHORT p)
{
    return READ_REGISTER_USHORT((PUSHORT)((char*)mappedSysIoPort + (UINT64)p));
}
DECLINLINE(ULONG) READ_SYSIO_ULONG(PULONG p)
{
    return READ_REGISTER_ULONG((PULONG)((char*)mappedSysIoPort + (UINT64)p));
}

#endif
